package com.ruoyi.pc.service.impl;

import com.ruoyi.pc.domain.LbDevice;
import com.ruoyi.pc.mapper.LbDeviceMapper;
import com.ruoyi.pc.service.ILbDeviceService;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 设备Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-06-21
 */
@Service
public class LbDeviceServiceImpl implements ILbDeviceService
{
    @Autowired
    private LbDeviceMapper lbDeviceMapper;

    /**
     * 查询设备
     * 
     * @param id 设备ID
     * @return 设备
     */
    @Override
    public LbDevice selectLbDeviceById(Long id)
    {
        return lbDeviceMapper.selectLbDeviceById(id);
    }

    /**
     * 查询设备列表
     * 
     * @param lbDevice 设备
     * @return 设备
     */
    @Override
    public List<LbDevice> selectLbDeviceList(LbDevice lbDevice)
    {
        return lbDeviceMapper.selectLbDeviceList(lbDevice);
    }

    /**
     * 新增设备
     * 
     * @param lbDevice 设备
     * @return 结果
     */
    @Override
    public int insertLbDevice(LbDevice lbDevice)
    {
        lbDevice.setCreateTime(DateUtils.getNowDate());
        return lbDeviceMapper.insertLbDevice(lbDevice);
    }

    /**
     * 修改设备
     * 
     * @param lbDevice 设备
     * @return 结果
     */
    @Override
    public int updateLbDevice(LbDevice lbDevice)
    {
        return lbDeviceMapper.updateLbDevice(lbDevice);
    }

    /**
     * 批量删除设备
     * 
     * @param ids 需要删除的设备ID
     * @return 结果
     */
    @Override
    public int deleteLbDeviceByIds(Long[] ids)
    {
        return lbDeviceMapper.deleteLbDeviceByIds(ids);
    }

    /**
     * 删除设备信息
     * 
     * @param id 设备ID
     * @return 结果
     */
    @Override
    public int deleteLbDeviceById(Long id)
    {
        return lbDeviceMapper.deleteLbDeviceById(id);
    }
}
